<template>
  <div>
    <!-- 轮播图 -->
    <div>
      <van-swipe @change="onChange">
        <van-swipe-item>
          <img src="@/assets/imgs/mainPage/banner.png" class="scansell-img" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/imgs/mainPage/banner.png" class="scansell-img" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/imgs/mainPage/banner.png" class="scansell-img" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/imgs/mainPage/banner.png" class="scansell-img" />
        </van-swipe-item>
        <template #indicator>
          <div class="custom-indicator">{{ current + 1 }}/4</div>
        </template>
      </van-swipe>
    </div>

    <!-- 图标 -->
    <div class="clomn-style">
      <div v-for="(items, index) in this.list" :key="index" class="row-style">
        <div
          v-for="(item, index1) in items"
          :key="index + '-' + index1"
          style="text-aligin:center"
          class="home-layout"
        >
          <div class="icon-style" @click="toRouter(item.router)">
            <van-image round width="50px" height="50px" :src="item.img" />
            <br />
          </div>
          <span>{{ item.name }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      current: 0,
      activeIndex: 1,
      list: [
        [
          {
            name: "申请收集",
            img: require("@/assets/imgs/mainPage/申请收集.png"),
            router: "",
          },
          {
            name: "扫码收集",
            img: require("@/assets/imgs/mainPage/扫码收集.png"),
            router: "/ScanColl/ScanCodeCell",
          },
          {
            name: "箱袋绑定",
            img: require("@/assets/imgs/mainPage/箱袋绑定.png"),
            router: "/boxBind",
          },
          {
            name: "院内暂存",
            img: require("@/assets/imgs/mainPage/院内暂存.png"),
            router: "/yardScanWaste",
          },
          {
            name: "院内出库",
            img: require("@/assets/imgs/mainPage/院内出库.png"),
            router: "/outStock",
          },
          {
            name: "交换确认",
            img: require("@/assets/imgs/mainPage/交接确认(1).png"),
            router: "",
          },
          {
            name: "扫码追溯",
            img: require("@/assets/imgs/mainPage/扫码追溯(2).png"),
            router: "",
          },
        ],
        [
          {
            name: "入库管理",
            img: require("@/assets/imgs/mainPage/入库管理.png"),
            router: "",
          },
          {
            name: "出库管理",
            img: require("@/assets/imgs/mainPage/出库管理.png"),
            router: "",
          },
          {
            name: "医废处理",
            img: require("@/assets/imgs/mainPage/医废处理.png"),
            router: "/delwith",
          },
          {
            name: "交接确认",
            img: require("@/assets/imgs/mainPage/交接确认(1).png"),
            router: "",
          },
          {
            name: "扫码追溯",
            img: require("@/assets/imgs/mainPage/扫码追溯(2).png"),
            router: "",
          },
        ],
        [
          {
            name: "扫码追溯",
            img: require("@/assets/imgs/mainPage/扫码追溯(2).png"),
            router: "",
          },
        ],
      ],
    };
  },
  methods: {
    onChange(index) {
      this.current = index;
    },
    toRouter(router) {
      this.$router.push({
        path: router,
      });
    },
  },
  created() {},
};
</script>

<style scoped lang="less">
.clomn-style {
  display: flex;
  flex-direction: column;
  background-color: #f2f2f2;
  //   height: 50vh;
  .row-style {
    display: flex;
    justify-content: flex-start;
    background-color: #ffffff;
    // align-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 2vh;
    .home-layout {
      display: flex;
      width: 33.3333%;
      flex-direction: column;
      align-items: center;
      // flex: 33.33333%;
      margin: 10px 0;
      & div {
        text-align: center;
      }
      & span {
        display: block;
        margin-top: 10px;
        font-size: 0.8rem;
        color: #707070;
      }
      .icon-style {
        border-radius: 50%;
        height: 50px;
        width: 50px;
        background-color: #ffffff;
        // border: 1px solid #07c160;
      }
    }
  }
}
.custom-indicator {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 5px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.1);
}
& .scansell-img {
  width: 100vw;
  height: 30vh;
}
.foot-navigat {
  // position: absolute;
  // bottom: 0;
  // width: 100vw;

  height: 60px;
  border-top: 1px solid #ffffff;
  background-color: #409eff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  color: #ffffff;
  font-size: 15px;
  .active-sty {
    color: #f56c6c;
    font-weight: 800;
  }
  & > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    & > i {
      font-size: 23px;
    }
  }
}
</style>
